package com.ticket.sass.common.entity.tenant;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author ywb
 * @since 2024-03-07
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("order_card_recharges")
@ApiModel(value="OrderCardRechargesEntity对象")
public class OrderCardRechargeEntity implements Serializable {
    /**
     * 未支付超时失效时长（秒）
     */
    public static long UNPAID_COUNTDOWN = 60 * 10;

    @ApiModelProperty(value = "订单号")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    
    @ApiModelProperty(value = "会员卡 id")
    private Long cardId;

    @ApiModelProperty(value = "会员充值项 id")
    private Long cardRechargeId;

    @ApiModelProperty(value = "订单 id")
    private Long orderId;

    @ApiModelProperty(value = "用户 id")
    private Long userId;

    @ApiModelProperty(value = "影院 id")
    private Long cinemaId;
    
    @ApiModelProperty(value = "租户 id")
    private Long tenantId;
    
    @ApiModelProperty(value = "充值金额")
    private BigDecimal rechargeAmount;

    @ApiModelProperty(value = "赠送金额")
    private BigDecimal giftAmount;

    
    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    public LocalDateTime createdAt;
    
    @ApiModelProperty(value = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    public LocalDateTime updatedAt;
    
    @TableField(select = false)
    @ApiModelProperty(value = "删除时间")
    @TableLogic(value = "null", delval = "now()")
    public LocalDateTime deletedAt;
    
    @TableField(exist = false)
    @ApiModelProperty(value = "订单号")
    private String orderNo;
    
    @TableField(exist = false)
    @ApiModelProperty(value = "支付价格")
    private BigDecimal payPrice;
    
    @TableField(exist = false)
    @ApiModelProperty(value = "支付状态")
    private Integer payStatus;
    
    @TableField(exist = false)
    @ApiModelProperty(value = "支付类型")
    private Integer payType;
    
    @TableField(exist = false)
    @ApiModelProperty(value = "支付时间")
    private LocalDateTime payTime;
    
    @TableField(exist = false)
    @ApiModelProperty(value = "订单创建时间")
    private LocalDateTime orderCreatedAt;

    @TableField(exist = false)
    private MemberCardRechargeEntity memberCardRecharge;
}
